package com.sci99.ex.model;

import org.zkoss.zul.AbstractTreeModel;

public class DptModel extends AbstractTreeModel<DptNode> {

	public DptModel(DptNode root) {
		super(root);
	}

	public DptModel(DptNode root, boolean muti) {
		super(root);
		this.setMultiple(muti);
	}

	@Override
	public boolean isLeaf(DptNode node) {
		return node.getChildren().size() == 0;
	}

	@Override
	public DptNode getChild(DptNode parent, int index) {
		return parent.getChildren().get(index);
	}

	@Override
	public int getChildCount(DptNode parent) {
		return parent.getChildren().size();
	}

}
